package com.servlet;

import com.dao.UserInfDao;
import com.dao.searchdao;
import com.dao.searchdaoimpl;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class shenhe extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        searchdao s=new searchdaoimpl();
         String id=s.searchshcookie(req);
        System.out.println("cookie="+id);
         String sql="update product set Audit=? where ProductID=?";
        UserInfDao u=new UserInfDao();
        u.update(sql,"1",id);
        resp.sendRedirect("ddsh.jsp");
    }
}
